﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace MyFloridaHouse.libSvOpenDistricts.MapTools
{
    public class MapDistance
    {

    //    /// <summary>         
    //    /// Calculate the distance between two geocodes. Defaults to using Miles.  
    //    ///  from http://silverlightfoundry.blogspot.com/2009/07/bing-maps-silverlight-control-part-5.html
    //    /// </summary>         
    //    /// 
    //    public static double CalcDistance(double lat1, double lng1, double lat2, double lng2)        
    //    {

    //        return CalcDistance(lat1, lng1, lat2, lng2);        
        
    //    }        
        
    //    /// <summary>         
    //    /// Calculate the distance between two geocodes.         
    //    /// </summary>         

    //    public static double CalcDistance(double lat1, double lng1, double lat2, double lng2, double earthRadiusInMiles )        
    //    {
    //        const double EARTH_RADIUS_IN_MILES = 3956.0;
    //        double radius = earthRadiusInMiles;            
    //        return radius * 2 * Math.Asin(Math.Min(1, Math.Sqrt((Math.Pow(Math.Sin((DiffRadian(lat1, lat2)) / 2.0), 2.0) 
    //            + Math.Cos(ToRadian(lat1)) * Math.Cos(ToRadian(lat2)) * Math.Pow(Math.Sin((DiffRadian(lng1, lng2)) / 2.0), 2.0)))));        
    //    }
    }
}
